    //<![CDATA[
    var iconBlue = new GIcon(); 
    iconBlue.image = 'blue.png';
	iconBlue.shadow = 'http://labs.google.com/ridefinder/images/mm_20_shadow.png';
    iconBlue.iconSize = new GSize(21, 34);
    iconBlue.shadowSize = new GSize(31, 34);
    iconBlue.iconAnchor = new GPoint(11, 34);
    iconBlue.infoWindowAnchor = new GPoint(5, 1);

    var iconRed = new GIcon(); 
    iconRed.image = 'red.png';
    iconRed.shadow = 'http://labs.google.com/ridefinder/images/mm_20_shadow.png';
    iconRed.iconSize = new GSize(21, 34);
    iconRed.shadowSize = new GSize(31, 34);
    iconRed.iconAnchor = new GPoint(11, 34);
    iconRed.infoWindowAnchor = new GPoint(5, 1);
	
    var iconGreen = new GIcon(); 
    iconGreen.image = 'green.png';
    iconGreen.shadow = 'http://labs.google.com/ridefinder/images/mm_20_shadow.png';
    iconGreen.iconSize = new GSize(21, 34);
    iconGreen.shadowSize = new GSize(31, 34);
    iconGreen.iconAnchor = new GPoint(11, 34);
    iconGreen.infoWindowAnchor = new GPoint(5, 1);

    var Icons = [];
    Icons["start"] = iconGreen;
    Icons["stop"] = iconRed;
    Icons["default"] = iconBlue;

    function load(valueTID) {
      if (GBrowserIsCompatible()) {
        var map = new GMap2(document.getElementById("map"));
        map.addControl(new GSmallMapControl());
        map.addControl(new GMapTypeControl());
        map.setCenter(new GLatLng(56.285678, 43.965225), 11);
		map.enableDoubleClickZoom();
		map.disableScrollWheelZoom();
		// Инициализация массива для точек
		var points = new Array();
		// Устанавливаем режим (act) и ID трека (tid)
        GDownloadUrl("handler.php?act=display&tid=" + valueTID, function(data) {
          var xml = GXml.parse(data);
          var markers = xml.documentElement.getElementsByTagName("marker");
          for (var i = 0; i < markers.length; i++) {
            var type = markers[i].getAttribute("status");
            var point = new GLatLng(parseFloat(markers[i].getAttribute("lat")),
                                    parseFloat(markers[i].getAttribute("lng")));
			points.push(point);
			new GMarker(point, Icons["start"]);
			//Определение цвета иконки
		   if (i==0) var marker = new GMarker(point, Icons["start"]);
			else if (i==markers.length-1) var marker = new GMarker(point, Icons["stop"]);
			else var marker = new GMarker(point, Icons["default"]);
            map.addOverlay(marker);
          }
		  if (markers.length>2) {
			  poly = new GPolyline(points, "#000000", 3, 0.7);
			  map.addOverlay(poly);
		  }
        });
      }
    }

    //]]>